package com.example.demo.controller;
import com.example.demo.entity.Info;
import com.example.demo.mapper.InforMapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import java.util.List;

import java.sql.Timestamp;
import java.util.Date;

@Api(tags="infor")
@RestController
@EnableSwagger2
public class InforController {
    @Autowired
    private InforMapper inforMapper;
    @ApiOperation(value = "查询时间")
    @GetMapping("/getAllInfor")
    public List<Infor> getAll(String starttime, String endtime){

        return inforMapper.getAll(starttime,endtime);
    }
    @ApiOperation(value = "模糊查询")
    @GetMapping("/getname")
    public List<Infor> getname(String names){
        return inforMapper.getname(names);
    }
    @ApiOperation(value = "添加信息")
    @GetMapping("/addInfor")
    public int AddUser(Infor infor){
        if (infor!=null){
            if (infor.getId()!=0){

            }
        }
        return inforMapper.insertInfor(infor);
    }

}